<template>
  <el-button
    v-bind="$attrs"
    :class="['axiom-button', `axiom-button--${type}`]"
  >
    <AxiomIcon v-if="typeof icon === 'string' && icon" :name="icon" class="axiom-button__icon" />
    <slot />
  </el-button>
</template>

<script setup>
import AxiomIcon from './AxiomIcon.vue';

defineOptions({
  name: 'AxiomButton'
});

defineProps({
  type: {
    type: String,
    default: 'default',
  },
  icon: {
    type: [String, Object], // 保持与 Element Plus 的 icon prop 兼容
    default: null,
  },
});
</script>

<style lang="scss">
@use '../../styles/components/common/axiom-button';
</style> 